﻿using System;
using System.Collections.Generic;

namespace RexToy.Cassandra
{
    public interface IColumnFamily<K, C>
    {
        string Name { get; }

        void Insert(K key, C column, object value);
        void Remove(K key, C column);
        void Remove(K key);

        object Select(K key, C column);
        IRow<K, C> Select(K key, int count = 10, bool reversed = false);
        IRow<K, C> Select(K key, C start, C finish, int count = 10, bool reversed = false);

        //TODO:IRow<K> SelectEntireRow(K key, int granularity = 50);

        IEnumerable<IRow<K, C>> Select(IEnumerable<K> keys, int count = 10, bool reversed = false);
        IEnumerable<IRow<K, C>> Select(IEnumerable<K> keys, C start, C finish, int count = 10, bool reversed = false);

        IEnumerable<IRow<K, C>> List(int rowCount = 100, int columnCount = 10, bool reversedColumn = false);
        IEnumerable<IRow<K, C>> List(C startColumn, C finishColumn, int rowCount = 100, int columnCount = 10, bool reversedColumn = false);
        IEnumerable<IRow<K, C>> List(K startKey, K finishKey, C startColumn, C finishColumn, int rowCount = 100, int columnCount = 10, bool reversedColumn = false);
    }
}
